#include "Acceptor.hpp"
#include "TcpConnection.hpp"
#include <iostream>

using std::cout;
using std::endl;

int main()
{
    ln::Acceptor acceptor(8000);
    acceptor.ready();
    cout << "server start listening..." << endl;

    int netfd = acceptor.accept();

    ln::TcpConnection tcp(netfd);
    cout << tcp.toString() << " has connected successfully" << endl;

    tcp.send("welcome to server!");

    cout << "recv msg is " << tcp.receive() << endl;

    return 0;
}

